<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="sealte.wdgf.model.system.*,sealte.wdgf.model.pojo.Pet" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	HTMLConfigObject hco = (HTMLConfigObject)application.getAttribute("HTMLConfig");
	List<Pet> petList = (List<Pet>)session.getAttribute("petList");
	//session.invalidate();
	SessionMapObject online = (SessionMapObject)application.getAttribute("SessionMap");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=hco.getTitle() %></title>
<link rel="stylesheet" type="text/css" href="css/div2.css">
</head>
<body>
<div>
<table>
<tr><th>ID</th><th>NAME</th><th>COLOR</th><th>AGE</th></tr>
<%
	ListIterator<Pet> li = petList.listIterator();
	int id = 0;
	while(li.hasNext()){
		Pet pet = li.next();
%>
<tr><td><%=(++id) %></td><td><%=pet.getName() %></td><td><%=pet.getColor() %></td><td><%=pet.getAge() %></td></tr>
<%				
	}
%>
</table>
</div>
<br/>
<div>
<table>
	<tr><th>sessionId</th><th>user</th></tr>
<%
	for(String sessionId:online.getSessionMap().keySet()){
%>
	<tr><td><%=sessionId %></td><td><%=online.get(sessionId) %></td></tr>
<%
	}
%>
</table>
</div>
<br/>
<a href="InvalidateSession">InvalidateSession</a>
<br/>
<a href="admin/add_new.jsp">Add new</a>
</body>
</html>